<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>embedme: libemb::Directory Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">embedme
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>libemb</b></li><li class="navelem"><a class="el" href="classlibemb_1_1_directory.html">Directory</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classlibemb_1_1_directory-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">libemb::Directory Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>目录类.  
 <a href="classlibemb_1_1_directory.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_file_util_8h_source.html">FileUtil.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a03d242faec4eac3a51dab3988ce4f03f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_directory.html#a03d242faec4eac3a51dab3988ce4f03f">enterDir</a> (const std::string &amp;dirName)</td></tr>
<tr class="memdesc:a03d242faec4eac3a51dab3988ce4f03f"><td class="mdescLeft">&#160;</td><td class="mdescRight">进入目录  <a href="classlibemb_1_1_directory.html#a03d242faec4eac3a51dab3988ce4f03f">More...</a><br /></td></tr>
<tr class="separator:a03d242faec4eac3a51dab3988ce4f03f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a54d077f53178ad60f2bb5baeaf15b679"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_directory.html#a54d077f53178ad60f2bb5baeaf15b679">currentDir</a> ()</td></tr>
<tr class="memdesc:a54d077f53178ad60f2bb5baeaf15b679"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取当前目录路径  <a href="classlibemb_1_1_directory.html#a54d077f53178ad60f2bb5baeaf15b679">More...</a><br /></td></tr>
<tr class="separator:a54d077f53178ad60f2bb5baeaf15b679"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad00e0ce33e8ffbcfb6a6300ae140eb7c"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_directory.html#ad00e0ce33e8ffbcfb6a6300ae140eb7c">getFileList</a> ()</td></tr>
<tr class="memdesc:ad00e0ce33e8ffbcfb6a6300ae140eb7c"><td class="mdescLeft">&#160;</td><td class="mdescRight">列出当前目录下的所有文件(包含目录)  <a href="classlibemb_1_1_directory.html#ad00e0ce33e8ffbcfb6a6300ae140eb7c">More...</a><br /></td></tr>
<tr class="separator:ad00e0ce33e8ffbcfb6a6300ae140eb7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:adfbe7b0c9641cd9f4aaac0b6b9118594"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_directory.html#adfbe7b0c9641cd9f4aaac0b6b9118594">isEmpty</a> (const std::string &amp;dirName)</td></tr>
<tr class="memdesc:adfbe7b0c9641cd9f4aaac0b6b9118594"><td class="mdescLeft">&#160;</td><td class="mdescRight">判断目录是否为空  <a href="classlibemb_1_1_directory.html#adfbe7b0c9641cd9f4aaac0b6b9118594">More...</a><br /></td></tr>
<tr class="separator:adfbe7b0c9641cd9f4aaac0b6b9118594"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a70d9a96e17b03e8468aef71dddd9dbeb"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_directory.html#a70d9a96e17b03e8468aef71dddd9dbeb">exists</a> (const std::string &amp;dirName)</td></tr>
<tr class="memdesc:a70d9a96e17b03e8468aef71dddd9dbeb"><td class="mdescLeft">&#160;</td><td class="mdescRight">判断目录是否存在  <a href="classlibemb_1_1_directory.html#a70d9a96e17b03e8468aef71dddd9dbeb">More...</a><br /></td></tr>
<tr class="separator:a70d9a96e17b03e8468aef71dddd9dbeb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad72f9332a445c9bb145ca36a96f11c46"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_directory.html#ad72f9332a445c9bb145ca36a96f11c46">getSize</a> (const std::string &amp;dirName)</td></tr>
<tr class="memdesc:ad72f9332a445c9bb145ca36a96f11c46"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取目录大小(包含子目录及所有文件，包括硬链接文件)  <a href="classlibemb_1_1_directory.html#ad72f9332a445c9bb145ca36a96f11c46">More...</a><br /></td></tr>
<tr class="separator:ad72f9332a445c9bb145ca36a96f11c46"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a964eb27c98070822509f01370ab12e22"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_directory.html#a964eb27c98070822509f01370ab12e22">createDir</a> (const std::string &amp;dirName, bool recursive=false)</td></tr>
<tr class="memdesc:a964eb27c98070822509f01370ab12e22"><td class="mdescLeft">&#160;</td><td class="mdescRight">创建目录  <a href="classlibemb_1_1_directory.html#a964eb27c98070822509f01370ab12e22">More...</a><br /></td></tr>
<tr class="separator:a964eb27c98070822509f01370ab12e22"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a75d5d948f45d6e0e6e1e81506d61e143"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_directory.html#a75d5d948f45d6e0e6e1e81506d61e143">removeDir</a> (const std::string &amp;dirName, bool recursive=false)</td></tr>
<tr class="memdesc:a75d5d948f45d6e0e6e1e81506d61e143"><td class="mdescLeft">&#160;</td><td class="mdescRight">删除目录  <a href="classlibemb_1_1_directory.html#a75d5d948f45d6e0e6e1e81506d61e143">More...</a><br /></td></tr>
<tr class="separator:a75d5d948f45d6e0e6e1e81506d61e143"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab3376469786772477171d2b5c7800172"><td class="memItemLeft" align="right" valign="top">static std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_directory.html#ab3376469786772477171d2b5c7800172">getFileList</a> (const std::string &amp;dirName, const std::string &amp;regexp)</td></tr>
<tr class="memdesc:ab3376469786772477171d2b5c7800172"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取目录下的文件列表(包含目录)  <a href="classlibemb_1_1_directory.html#ab3376469786772477171d2b5c7800172">More...</a><br /></td></tr>
<tr class="separator:ab3376469786772477171d2b5c7800172"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>目录类. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a964eb27c98070822509f01370ab12e22"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a964eb27c98070822509f01370ab12e22">&#9670;&nbsp;</a></span>createDir()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::Directory::createDir </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>dirName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>recursive</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>创建目录 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dirName</td><td></td></tr>
    <tr><td class="paramname">recursive</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true </dd>
<dd>
false </dd></dl>

</div>
</div>
<a id="a54d077f53178ad60f2bb5baeaf15b679"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a54d077f53178ad60f2bb5baeaf15b679">&#9670;&nbsp;</a></span>currentDir()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">string libemb::Directory::currentDir </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取当前目录路径 </p>
<dl class="section return"><dt>Returns</dt><dd>std::string </dd></dl>

</div>
</div>
<a id="a03d242faec4eac3a51dab3988ce4f03f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a03d242faec4eac3a51dab3988ce4f03f">&#9670;&nbsp;</a></span>enterDir()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::Directory::enterDir </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>dirName</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>进入目录 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dirName</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true </dd>
<dd>
false </dd></dl>

</div>
</div>
<a id="a70d9a96e17b03e8468aef71dddd9dbeb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a70d9a96e17b03e8468aef71dddd9dbeb">&#9670;&nbsp;</a></span>exists()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::Directory::exists </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>dirName</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>判断目录是否存在 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dirName</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true 目录存在 </dd>
<dd>
false 目录不存在或dirName不是目录 </dd></dl>

</div>
</div>
<a id="ad00e0ce33e8ffbcfb6a6300ae140eb7c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad00e0ce33e8ffbcfb6a6300ae140eb7c">&#9670;&nbsp;</a></span>getFileList() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">vector&lt; string &gt; libemb::Directory::getFileList </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>列出当前目录下的所有文件(包含目录) </p>
<dl class="section return"><dt>Returns</dt><dd>std::vector&lt;std::string&gt; </dd></dl>

</div>
</div>
<a id="ab3376469786772477171d2b5c7800172"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab3376469786772477171d2b5c7800172">&#9670;&nbsp;</a></span>getFileList() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static std::vector&lt;std::string&gt; libemb::Directory::getFileList </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>dirName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>regexp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取目录下的文件列表(包含目录) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dirName</td><td>目录名称 </td></tr>
    <tr><td class="paramname">regexp</td><td>正则表达式(用于匹配文件名) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>std::vector&lt;std::string&gt; </dd></dl>

</div>
</div>
<a id="ad72f9332a445c9bb145ca36a96f11c46"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad72f9332a445c9bb145ca36a96f11c46">&#9670;&nbsp;</a></span>getSize()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int libemb::Directory::getSize </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>dirName</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取目录大小(包含子目录及所有文件，包括硬链接文件) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dirName</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>int </dd></dl>

</div>
</div>
<a id="adfbe7b0c9641cd9f4aaac0b6b9118594"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adfbe7b0c9641cd9f4aaac0b6b9118594">&#9670;&nbsp;</a></span>isEmpty()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::Directory::isEmpty </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>dirName</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>判断目录是否为空 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dirName</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true 目录为空或不存在 </dd>
<dd>
false 目录不为空 </dd></dl>

</div>
</div>
<a id="a75d5d948f45d6e0e6e1e81506d61e143"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a75d5d948f45d6e0e6e1e81506d61e143">&#9670;&nbsp;</a></span>removeDir()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::Directory::removeDir </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>dirName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>recursive</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>删除目录 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dirName</td><td></td></tr>
    <tr><td class="paramname">recursive</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true </dd>
<dd>
false </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/<a class="el" href="_file_util_8h_source.html">FileUtil.h</a></li>
<li>src/FileUtil.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
</html>
